// 云函数入口文件
const cloud = require('wx-server-sdk')
cloud.init({
  env:"cloud2-4gncvam39e2323e9",
})
const db=cloud.database();
// 云函数入口函数
/* 根据当前用户openid从表userALL查询用户信息 */
exports.main = async (event, context) => {
  const openid = cloud.getWXContext().OPENID
  var res=await db.collection("lastchat").where({
    openid1:openid
  }).orderBy('sendTimeTS', 'desc').get();
  return res;
}


